package jp.co.toshiba.ffsa.service.common;

import java.util.List;

import jp.co.toshiba.ffsa.entity.Workflow;

public class WorkflowService  extends AbstractService<Workflow> {

    public Workflow findById(String projectId,String workflowId,Integer revision) {
        return select().id(projectId, workflowId, revision).getSingleResult();
    }

    public List<Workflow> selectAllPaged(int startIndex,int numItems){
        return findAllPaged("projectId, workflowId, revision", startIndex, numItems);
    }

    public int deleteItem(String projectId,String workflowId,Integer revision) {
        Workflow workflow = findById(projectId, workflowId, revision);
        return removeItem(workflow);
    }

    public void updateItem(Workflow workflow){
        update(workflow);
    }
}